#enque_thread_request.py
import wsgiref.handlers

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template

from xmw.tianya import error_tianya
from xmw.tianya.bot import *
from xmw import counter
import xmw

import os

class MainPage(xmw.RequestHandler):
    def get(self):
        e=None
        if  not (self.request.GET.has_key('thread_id')):
            e = error_tianya.ARGUMENT_FAULT("/thread_info?thread_id=XXXXXX, where now it is %s"%str(self.request))
        else:
            thread_id   =self.request.GET['thread_id']
            
        q=ThreadRequest.all()
        q.filter('thread =",thread_id)
        
        e=error_tianya.OK("/enque_thread_request?thread_id=%s;url=%s"%(thread_id,url))
        
        self.render_error(e)
        

def main():
  application = webapp.WSGIApplication(
                                       [('/enque_thread_request', MainPage)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
  main()
  